import Vue from'vue'
import VueRouter from 'vue-router'
import login from './login.vue'
import $ from 'jquery/dist/jquery.js'
import 'bootstrap/dist/css/bootstrap.css'
import './css/index.css'
import router from './vue-router.js'
// import {Button,Header,Swipe, SwipeItem} from 'mint-ui'
import MintUi from 'mint-ui'
import './libs/mui-master/dist/css/mui.min.css'
import './libs/mui-master/examples/hello-mui/css/icons-extra.css'
import VueResource from 'vue-resource'
import 'mint-ui/lib/style.css'

// import mint from 'mint-ui'
// import 'mint-ui/lib/style.css'
// Vue.use(mint)
Vue.use(VueRouter)
Vue.use(VueResource);
Vue.use(MintUi)
import VuePreview from 'vue-preview'
Vue.use(VuePreview)
// Vue.use(preview, {
//   mainClass: 'pswp--minimal--dark',
//   barsSize: {top: 0, bottom: 0},
//   captionEl: false,
//   fullscreenEl: false,
//   shareEl: false,
//   bgOpacity: 0.85,
//   tapToClose: true,
//   tapToToggleControls: false
// })
// 
Vue.http.options.root = 'http://www.liulongbin.top:3005'
// var login = {
// 	template:'#temp'
// }
// Vue.component(Button.name,Button);
// Vue.component(Header.name,Header);
// Vue.component(Swipe.name, Swipe);
// Vue.component(SwipeItem.name, SwipeItem);

Vue.filter('times',function(newVal,str){

	if (str == 'YYYY-MM-DD') {
		var tm = new Date(newVal);
		var y = tm.getFullYear();
		var m = tm.getMonth()
		var d = tm.getDate();
		return `${y}-${m+1}-${d}`
	} else if(str == 'YYYY-MM-DD HH-mm-ss'){
		var tm = new Date(newVal);
		var y = tm.getFullYear();
		var m = tm.getMonth()
		var d = tm.getDate();
		var h = tm.getHours();
		var mt = tm.getMinutes()
		var s = tm.getSeconds();
		return `${y}-${m+1}-${d} ${h}:${mt}:${s}`
	}
	
})

var vm =new Vue({
	el:'#app',
	data:{
		msg:123,
		
	},
	render:c => c(login),
	router:router,
	watch:{
		"$router.path":function(newVal){
			if (newVal == './home') {
				this
			} else{
				
			}
		}
	}
})
